<?php
namespace data\service;
use data\model\MoneysModel;

class MoneysService extends BaseService {

    private $moneysModel = null;

    public function __construct() {
        parent::__construct();
        $this->moneysModel = new MoneysModel();
    }
    public function addRecords( $score , $uid , $type , $txt ){
        $retVal = $this->moneysModel->save(['uid'=>$uid,'scores'=>$score,'ctime'=>time(),'type' => $type ,'text' => $txt]);
        if( $retVal ){
            return $retVal;
        }
        return 0;
    }

    public function sumMoneys( $uid ){
        $sumScores = $this->moneysModel->getSum(['uid'=>$uid],'scores');
        return $sumScores;
    }

    public function selectMoneys(){

    }

    

}
